home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / barcodes.zip / SAMPLE1.ZIP / BARVW.H < prev    next >
C/C++ Source or Header  |  1994-11-07  |  3KB  |  109 lines

  1. // barvw.h : interface of the CBarView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. // (c) Copyright 1994 HEX TECHNOLOGY. All rights reserved.
  5. // This sample code is provided as a example implementation
  6. // using barcodes.dll.  You may only distribute or modify this
  7. // code if you purchase a license for barcodes.dll.
  8.  
  9.  
  10. class CBarView : public CFormView
  11. {
  12. protected: // create from serialization only
  13.     CBarView();
  14.     DECLARE_DYNCREATE(CBarView)
  15.  
  16. public:
  17.     //{{AFX_DATA(CBarView)
  18.     enum { IDD = IDD_BARTEST_FORM };
  19.     CButton    m_Preview;
  20.     CString    m_sData;
  21.     CString    m_sText;
  22.     BOOL    m_bBold;
  23.     BOOL    m_bCheck;
  24.     CString    m_sFontFace;
  25.     BOOL    m_bHorizontal;
  26.     BOOL    m_bItalic;
  27.     int        m_iRatio;
  28.     BOOL    m_bShowData;
  29.     BOOL    m_bSwitch;
  30.     int        m_iFontAdjust;
  31.     BOOL    m_bVertical;
  32.     CString    m_sStyle;
  33.     UINT    m_iWidth;
  34.     UINT    m_iHeight;
  35.     BOOL    m_bSpacer;
  36.     //}}AFX_DATA
  37.     BOOL m_bCentreBarcode;
  38.     int m_iStyle;    // we maintain this variable ourselves..
  39. // Attributes
  40. public:
  41.  
  42.  
  43. // Operations
  44. public:
  45.    void UpdatePreview();
  46.    void SaveToDoc();
  47.    void RestoreFromDoc(); 
  48.    void OnDataChange();
  49.     CBarDoc* GetDocument(); 
  50.     void SaveStyle();  
  51.     BOOL DrawBarcodePrivate(CDC *pDC,CRect rect);
  52. // Implementation
  53. public:
  54.     virtual ~CBarView();
  55. #ifdef _DEBUG
  56.     virtual void AssertValid() const;
  57.     virtual void Dump(CDumpContext& dc) const;
  58. #endif
  59.  
  60. protected:
  61.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  62.     virtual void OnUpdate(CView*, LPARAM, CObject*);
  63.     // Printing support
  64.     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  65.     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  66.     virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  67.     virtual void OnPrint(CDC* pDC, CPrintInfo*);
  68.     virtual void OnInitialUpdate();
  69. // Generated message map functions
  70. protected:
  71.     //{{AFX_MSG(CBarView)
  72.     afx_msg void OnBackground();
  73.     afx_msg void OnBarcolor();
  74.     afx_msg void OnKillfocus();
  75.     afx_msg void OnClicked();
  76.     afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
  77.     afx_msg void OnSelchangeStyle();
  78.     //}}AFX_MSG
  79.     DECLARE_MESSAGE_MAP()
  80. };
  81.  
  82. #ifndef _DEBUG  // debug version in barvw.cpp
  83. inline CBarDoc* CBarView::GetDocument()
  84.    { return (CBarDoc*)m_pDocument; }
  85. #endif
  86.  
  87. /////////////////////////////////////////////////////////////////////////////
  88.   class CBarFrame : public CMDIChildWnd
  89. {
  90.     DECLARE_DYNCREATE(CBarFrame)
  91. protected:
  92.     CBarFrame();            // protected constructor used by dynamic creation
  93.  
  94. // Attributes
  95. public:
  96.  
  97. // Operations
  98. public:
  99.     void Resize();
  100. // Implementation
  101. protected:
  102.     virtual ~CBarFrame();
  103.     virtual BOOL PreCreateWindow(CREATESTRUCT &lpCreateStruct);
  104.     // Generated message map functions
  105.     //{{AFX_MSG(CBarFrame)
  106.      //}}AFX_MSG
  107.     DECLARE_MESSAGE_MAP()
  108. };
  109.